package com.cnpc.fynetwork.retrofit;

import rx.Observable;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

/**
 * Created by bingju on 2017/1/12.
 * 观察者装饰器
 */

public class ObservableDecorator {
    public static <T> Observable<T> decorateMainThread(Observable<T> observable) {
        Observable<T> newObservable;
        newObservable = observable.subscribeOn(Schedulers.newThread())
                .observeOn(AndroidSchedulers.mainThread());
        return newObservable;
    }
}
